#include "iPlayerAI.h"
#include "HoldemState.h"
#include "PoseFromBB.h"

float iPlayerAI_prob::GetPushPnt(HoldemState &aHs)
{
	int allinCount=0;
	int posefromBB=0;
	int posefromBBPusher=0;
	float pushPeralin[5]={0.09f,0.07f,0.038f,0.038f,0.035f};
	float pushPerPose0Allin[9]={0.0f,0.07f,0.035f,0.02f,0.0f,0.0f,0.0f,0.0f,0.0f};
	float PushPnT=0;
	for(int i=0;i<9;i++)
	{
		if(aHs.player[i].action_type==AT_ALLIN)
		{
			allinCount++;		
			posefromBBPusher=i;
		}
	}
	posefromBBPusher=GetPoseFromBB(aHs,posefromBBPusher);
	posefromBB=GetPoseFromBB(aHs,_pose);

	PushPnT=pushPeralin[allinCount];
	if(allinCount==0)
	{
		PushPnT+=pushPerPose0Allin[posefromBB];
	}
	if(allinCount==1&&posefromBB<2)
	{
		PushPnT+=pushPerPose0Allin[posefromBBPusher];
	}
	PushPnT+=0.0032f*(10-(aHs.player[_pose].stack+aHs.player[_pose].betSize)/aHs.BBlind);
	return PushPnT;
}

